
// 工厂模式:创建的对象无法识别其类型
function createObject(color){
    const play1 = new Object();
    play1.color = color;
    play1.start = function () {
        console.log('white下棋');
    }
    return play1;
}
var aa = createObject('red');
console.log(typeof aa); // object
console.log('========工厂模式===========')
